package com.example.ibsp_demo.mapper.message;

import com.example.ibsp_demo.pojo.entity.message.PrivateSession;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface PrivateSessionMapper {
    int insert(PrivateSession session);
    List<PrivateSession> selectByUserId(int userId);


    PrivateSession selectById(@Param("sessionId") int sessionId);

    PrivateSession selectByUserPair(Map<String, Integer> userPair);
    int deleteSessionById(int sessionId);
    int updateLastMessage(PrivateSession session);
    int markSessionAsRead(@Param("sessionId") int sessionId, @Param("userId") int userId);
}